<?php
namespace Admin\Controller;
use Admin\Controller\CommonController;
class CommentController extends CommonController {
 
  //===================================产品订单
    public function index() {
    	$li=M('user');
        $list=$li->order('id desc')->where('zt=1')->select();
        $this->assign('list',$list);


        $this->display(); 
    }


        public function xiangqing(){
        $li=M('user');
        $id=I('get.id');
    $xinxi=$li->where('id='.$id)->find();
     $xinxi['img'] = explode(",",$xinxi['img']);
       $xinxi['content'] = explode(",",$xinxi['content']);
 foreach ($xinxi['img'] as $key1 => $value1) {
 foreach ($xinxi['content']  as $key => $value) {
                  if ($key1==$key) {
                      $img[$key1]['img']=$value1;
                      $img[$key1]['content']=$value;

                  }
 }
 }
  
           $this->assign('xinxi1',$img);
      $this->assign('img',$xinxi['img']);
$this->assign('xinxi',$xinxi);
   $this->assign('content',$xinxi['content']);
            $this->display();   
        }




    public function shenhe(){
      
        if(IS_POST){
           
              $id=I('post.id');

              $zt=I('post.zt');
           

        if ($zt==2) {
              $data['zt']=I('post.zt');
              $data['status']=1;
              $hh= M('user')->where(array('id'=>$id))->save($data);

      if($hh) {

            $this->success('审核完成',U('Comment/index'));

      }else{

     
        }
        }elseif ($zt==1) {
          $this->success('未审核',U('Comment/index'));
        }else{

        $data['zt']=I('post.zt');
            
              $hh= M('user')->where(array('id'=>$id))->save($data);

      if($hh) {

            $this->success('审核不合格',U('Comment/index'));

      }


         
        }

            
         


        }




    }






   

}

?>